// <copyright file="PieChart.cs" company="YUIAsp.Net">
// Copyright (c) 2009 All Right Reserved
// </copyright>
// <author>raul popescu</author>
// <email>dev@yuiasp.net</email>
// <date>2009-01-30</date>
// <summary>YUIAsp.Net File</summary>

using System.ComponentModel;
using System.Web.UI;

#region Embedded resources definitions
[assembly: WebResource("YUIAspNet.Chart.PieChart.js", "text/javascript")]
#endregion

namespace YUIAspNet
{
    /// <summary>
    /// Pie chart control.
    /// </summary>
    [ToolboxItem(true)]
    public class PieChart : BaseChart
    {
        /// <summary>
        /// Register the values to send to the client control for initialization.
        /// </summary>
        protected override void RegisterClientInitialization() 
        {
            base.RegisterClientInitialization();

            AddProperty("DataField", DataField);
            AddProperty("CategoryField", CategoryField);
        }

        /// <summary>
        /// Registers any additional scripts to include for this control.
        /// </summary>
        protected override void RegisterScriptReferences()
        {
            base.RegisterScriptReferences();
            AddScriptReference(new ScriptReference("YUIAspNet.Chart.PieChart.js", this.GetType().Assembly.FullName));
        }

        #region Public properties
        /// <summary>
        /// The field in each item that corresponds to the data value.
        /// </summary>
        public string DataField { get; set; }

        /// <summary>
        /// The field in each item that corresponds to the category value
        /// </summary>
        public string CategoryField { get; set; } 
        #endregion
        
     }
}
